package net.dodoman;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class Client {

	public static void main(String args[]) {
		// starts up the security manager
		if (System.getSecurityManager() == null) {
			System.setSecurityManager(new SecurityManager());
		}

		try {
			// get the RMI registry reference

			Registry registry = LocateRegistry.getRegistry(args[0]);

			// get the reference to the remote object
			SumEngine comp = (SumEngine) registry.lookup("SUM");

			// invoke the sum method on remote object
			Integer result = comp.sum(new Integer(args[1]), Integer(args[2]));
			System.out.println(args[1] + "+" + args[2] + "=" + result);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private static Integer Integer(String string) {
		return null;
	}
}